package mybatisplus;


import com.zoo.buyor.BuyorCustomApplication;
import com.zoo.buyor.user.dao.UserDao;
import com.zoo.buyor.user.domain.entity.User;
import com.zoo.buyor.user.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = BuyorCustomApplication.class)
//@RunWith(SpringRunner.class)
public class MybatisPlusCrud {
    @Autowired
    UserService userService;

    @Autowired
    UserDao userDao;
    @Test
    public void testUserInsert(){
        User user = new User();
        user.setId(1L);
        user.setName("阿左");
        user.setAvatar("");
        user.setSex(1);
        user.setOpenId("");
        user.setActiveStatus(1);
        user.setStatus(1);
    }

    @Test
    public void getByOpenId(){
        System.out.println( userDao.getByOpenId("123456"));
    }
}
